<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./Template/Template3.xhtml">

            <ui:define name="top">
                
                                <h:form>
                    <center>
                    <p:commandButton action="PaginaInicio" value="Menu Principal" immediate="true"/>
                    </center>
                    </h:form>
                <h:form>
                    <center>
                  
                    </center>
                </h:form>
            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form>
                          <p:commandButton action="PagoCE" value="nuevo" actionListener="#{payBean.prepararNuevo(evt)}"/>
                        
                        <p:dataTable value="#{payBean.lista}" var="item">
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Id"/>
                                </f:facet>
                                <h:outputText value="#{item.idpayment}"/>
                            </p:column>
                            <p:column sortBy="#{item.daysWorked}" filterBy="#{item.daysWorked}" >
                                <f:facet name="header">
                                    <h:outputText value="Dias Trabajados" />
                                </f:facet>
                                <h:outputText value="#{item.daysWorked}"/>
                            </p:column >
                            <p:column sortBy="#{item.hoursWorked}">
                                <f:facet name="header">
                                    <h:outputText value="Horas Trabajadas"/>
                                </f:facet>
                                <h:outputText value="#{item.hoursWorked}"/>
                            </p:column>
                            <p:column sortBy="#{item.overTime}">
                                <f:facet name="header">
                                    <h:outputText value="Tiempo Extra"/>
                                </f:facet>
                                <h:outputText value="#{item.overTime}"/>
                            </p:column>
                            <p:column sortBy="#{item.pay}">
                                <f:facet name="header">
                                    <h:outputText value="Pago"/>
                                </f:facet>
                                <h:outputText value="#{item.pay}"/>
                            </p:column>
                            <p:column sortBy="#{item.staffIdstaff}" >
                                <f:facet name="header">
                                    <h:outputText value=" Trabajador"/>
                                </f:facet>
                                <h:outputText value="#{item.staffIdstaff.name}"/>
                            </p:column>
                                              <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Editar"/>
                                </f:facet>
                                       <p:commandButton action="PagoCE" value="Editar" actionListener="#{payBean.prepararEditar}"/>
                            </p:column>
                                       <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Eliminar"/>
                                </f:facet>
                                           <p:commandButton action="PagoEliminar" value="Eliminar" actionListener="#{payBean.prepararEliminar}"/>
                            </p:column>
                        </p:dataTable>
                    </h:form>
                </f:view>

            </ui:define>

            <ui:define name="bottom">
                bottom
            </ui:define>

        </ui:composition>
  
    </body>
</html>
